package com.itheima.controller;

import com.itheima.service.SearchService;
import com.itheima.dto.SearchDto;
import com.itheima.vo.Result;
import com.itheima.vo.SearchVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author :wujunjie
 * createTime :2022-12-29 10:02
 * description :
 */
@RestController
@RequestMapping("/api/v1/article/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @PostMapping("/search")
    private Result search(@RequestBody SearchDto searchDto){
        List<SearchVo> searchVos=searchService.search(searchDto);
        return Result.success(searchVos);
    }
}
